<template>
  <view>

  </view>
</template>

<script>
  export default {
    data() {
      return {
        query: {},
        goodsDetail: {}
      };
    },
    onLoad(options) {
      this.query = options
      this.getGoodsDetail()
    },
    methods: {
      async getGoodsDetail() {
        const {
          data: res
        } = await uni.$http.get('/api/public/v1/goods/detail', this.query)
        // 3.2 请求失败
        if (res.meta.status !== 200) return uni.$showMsg()

        // 3.3 请求成功，为 data 中的数据赋值
        this.goodsDetail = res.message
      },
    }
  }
</script>

<style lang="scss">

</style>
